package com.babel.util.enums;

public enum ResultCodeEnum {

	CODE_400("400", "提交参数错误"),
	
	CODE_401("401", "用户登录已过期"),

	CODE_402("402", "重复提交"),

	CODE_403("403", "用户被拉入黑名单"),

	CODE_404("404", "资源不存在"),

	CODE_200("200", "接口请求成功"),

	CODE_500("500", "服务器异常"),

	CODE_501("501", "网络请求超时");

	private String value;

	private String description;

	private ResultCodeEnum(String value, String description) {
		this.value = value;
		this.description = description;
	}

	public String getValue() {
		// TODO Auto-generated method stub
		return value;
	}

	public String getDescription() {
		// TODO Auto-generated method stub
		return description;
	}
	
	public static ResultCodeEnum resolve(String value) {
        for (ResultCodeEnum type : values()) {
            if (type.getValue().equals(value)) {
                return type;
            }
        }
        return null;
    }
}
